package com.yy.hi.library.hilog;

import java.text.SimpleDateFormat;
import java.util.Locale;

/**
 * User: gongyongfeng2@yy.com
 * Date: 2020/6/11 21 :49
 */
public class HiLogMo {
    public static SimpleDateFormat sFormat = new SimpleDateFormat("yy-MM-dd HH:mm:ss",
            Locale.CHINA);
    public long timeMills;
    public int level;
    public String tag;
    public String log;

    public HiLogMo(long timeMills, int level, String tag, String log) {
        this.timeMills = timeMills;
        this.level = level;
        this.tag = tag;
        this.log = log;
    }

    public String flattened() {
        return getFlattened() + "\n" + log;
    }

    public String getFlattened() {
        return format(timeMills) + "|" + level + "|" + tag + "|:";
    }

    private String format(long timeMills) {
        return sFormat.format(timeMills);
    }
}
